import request from '@/utils/request'

// 查询新运单管理列表
export function listShipment(query) {
  return request({
    url: '/shipment/shipment/list',
    method: 'get',
    params: query
  })
}

export function trackShipmentList(query) {
  return request({
    url: '/shipment/shipment/trackShipmentList',
    method: 'get',
    params: query
  })
}

export function getDZShipmentList(query) {
  return request({
    url: '/shipment/shipment/getDZShipmentList',
    method: 'get',
    params: query
  })
}

// 查询新运单管理详细
export function getShipment(id) {
  return request({
    url: '/shipment/shipment/' + id,
    method: 'get'
  })
}

// 新增新运单管理
export function addShipment(data) {
  return request({
    url: '/shipment/shipment',
    method: 'post',
    data: data
  })
}

// 修改新运单管理
export function saveAbnormalShipment(data) {
  return request({
    url: '/shipment/shipment/saveAbnormalShipment',
    method: 'put',
    data: data
  })
}
// 修改新运单
export function updateShipment(data) {
  return request({
    url: '/shipment/shipment',
    method: 'put',
    data: data
  })
}

// 删除新运单管理
export function delShipment(id) {
  return request({
    url: '/shipment/shipment/' + id,
    method: 'delete'
  })
}

// 发运
export function dispatch(data) {
  return request({
    url: '/shipment/shipment/dispatch',
    method: 'put',
    data: data
  })
}

// 运抵
export function arrival(data) {
  return request({
    url: '/shipment/shipment/arrival',
    method: 'put',
    data: data
  })
}

// 运抵
export function printShipmentData(ids) {
  return request({
    url: '/shipment/shipment/printShipmentData/' + ids,
    method: 'get'
  })
}
// 下载签收单
export function printSignPdf(ids) {
  return request({
    url: '/shipment/shipment/printSignBase64Pdf/' + ids,
    method: 'get'
  })
}
